package com.wangzh.data.arithmetic.sort;

//递归
public class RecursionDemo {

    public static void main(String[] args) {
        System.out.println(mRecursion(5));
    }

    public static int sumRecursion(int num){
        if (num==1){
            return 1;
        }
        num =num+ sumRecursion(num-1);
        return num;
    }
    public static int mRecursion(int num){
        if (num==1){
            return 1;
        }
        num =num* mRecursion(num-1);
        return num;
    }
}
